]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdmUtil: make _startService support no username
authorRay Strode <rstrode@redhat.com>
Wed, 21 Aug 2013 22:05:55 +0000 (18:05 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 22 Aug 2013 13:40:51 +0000 (09:40 -0400)
commit fd11ad95f61b904d6f7014f8d56c1c27d88af65c factored
out duplicated code, but unintentionally dropped support
for beginning verification without a username.

This commit brings it back.

https://bugzilla.gnome.org/show_bug.cgi?id=706542

js/gdm/util.js

index bfbd1b37d1d936dc874581f0561e5f55d436e115..f42190220bbfe419545ea62bc991a0adc01dfa1d 100644 (file)
@@ -381,21 +381,38 @@ const ShellUserVerifier = new Lang.Class({
 
     _startService: function(serviceName) {
         this._hold.acquire();
-        this._userVerifier.call_begin_verification_for_user(serviceName,
-                                                            this._userName,
-                                                            this._cancellable,
-                                                            Lang.bind(this, function(obj, result) {
-            try {
-                obj.call_begin_verification_for_user_finish(result);
-            } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
-                return;
-            } catch(e) {
-                this._reportInitError('Failed to start verification for user', e);
-                return;
-            }
-
-            this._hold.release();
-        }));
+        if (this._userName) {
+           this._userVerifier.call_begin_verification_for_user(serviceName,
+                                                               this._userName,
+                                                               this._cancellable,
+                                                               Lang.bind(this, function(obj, result) {
+               try {
+                   obj.call_begin_verification_for_user_finish(result);
+               } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
+                   return;
+               } catch(e) {
+                   this._reportInitError('Failed to start verification for user', e);
+                   return;
+               }
+
+               this._hold.release();
+           }));
+        } else {
+           this._userVerifier.call_begin_verification(serviceName,
+                                                      this._cancellable,
+                                                      Lang.bind(this, function(obj, result) {
+               try {
+                   obj.call_begin_verification_finish(result);
+               } catch(e if e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
+                   return;
+               } catch(e) {
+                   this._reportInitError('Failed to start verification', e);
+                   return;
+               }
+
+               this._hold.release();
+           }));
+        }
     },
 
     _beginVerification: function() {